//! Theme.debug.js
//

(function() {

Type.registerNamespace('ThemeChain');

////////////////////////////////////////////////////////////////////////////////
// Theme

Theme = function Theme() {
    /// <field name="_initialized$2" type="Boolean" static="true">
    /// </field>
    Theme.initializeBase(this);
}
Theme._once$2 = function Theme$_once$2() {
    /// <summary>
    /// Dynamic overrides performed once upon loading
    /// </summary>
    /// <returns type="Boolean"></returns>
    Helpers.staticInheritClass((Theme).get_name(), (ThemeYoshi).get_name());
    Inform.debug('Theme.Once() start');
    new Await().loadScript(Uri.app('sc/PlaySpace.js')).loadCss(Uri.app('cs/PlaySpace.css')).addDx(function() {
        Inform.log('Theme.Once()');
        Theme.Update();
        $(document).bind('F2Event', FunctionKeys.F2);
        Master.MasterPage();
    }).commit();
    return !Theme._initialized$2;
}
Theme.Update = function Theme$Update() {
    /// <summary>
    /// Reenterant dynamic overrides performed in Master.cs for every new page load
    /// </summary>
    ThemeYoshi.pagesDataPath = Uri.join(ThemeBase.appPath, ThemeYoshi.pagesPartition);
    ThemeYoshi.bgImgUrl = Uri.versionize('url(' + Uri.join(ThemeYoshi.pagesDataPath, ThemeYoshi.currentPageName, 'background.jpg') + ')');
}


Theme.registerClass('Theme', ThemeYoshi);
Theme._initialized$2 = Theme._once$2();
})();

//! This script was generated using Script# v0.7.4.0
